package chain_user_config

import (
	"chain_bridge_service/internal/pkg/core"
	chain_user_config "chain_bridge_service/internal/repository/mongodb/chain_user_config"
)

type CreateChainData struct {
	CollectAddress string
	FeeAddress     string
	UserId         string
	ChainConfigId  string
	ChainName      string
	ChainId        int64
	FeePrivateKey  string
	BusinessId     string
}

func (s *service) Create(ctx core.Context, keyData *CreateChainData) error {
	model := chain_user_config.NewModel()
	model.CollectAddress = keyData.CollectAddress
	model.FeeAddress = keyData.FeeAddress
	model.UserId = keyData.UserId
	model.ChainConfigId = keyData.ChainConfigId
	//model.FeePrivateKey = keyData.FeePrivateKey
	model.BusinessId = keyData.BusinessId
	err := model.Create(s.db.GetDb())
	return err
}
